package com.junzhiit.nengji.cms.web.util.excel;

import java.util.ArrayList;
import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import com.junzhiit.nengji.bo.GoodsBO;
import com.junzhiit.nengji.bo.OrdersAndDetailsBO;
import com.junzhiit.nengji.bo.OrdersAndGoodsBO;
import com.junzhiit.nengji.bo.PayHistoryBO;
import com.junzhiit.nengji.bo.TransactionAnalysisBO;
import com.junzhiit.nengji.cms.web.vo.GoodsAnalysisInfoVO;
import com.junzhiit.nengji.cms.web.vo.GoodsAnalysisVO;
import com.junzhiit.nengji.cms.web.vo.ShopAnalysisVO;
import com.junzhiit.nengji.cms.web.vo.TransactionAnalysisVO;
import com.junzhiit.nengji.model.enums.AnalysisType;

public class GenerateWorkbook {

	/*
	 * public static HSSFWorkbook goodsReport(List<GoodsVO> list){ HSSFWorkbook
	 * workbook = new HSSFWorkbook(); List<ExcelElement> titles = new
	 * ArrayList<ExcelElement>(); titles.add(new ExcelElement("商品编号", "code",
	 * false, 18,false)); titles.add(new ExcelElement("商品名称", "name", false,
	 * 50,false)); titles.add(new ExcelElement("条码", "barcode", false,
	 * 18,false)); titles.add(new ExcelElement("类型", "typeName", false,
	 * 30,false)); titles.add(new ExcelElement("品牌", "brandName", false,
	 * 30,false)); titles.add(new ExcelElement("参考价", "referencePrice", false,
	 * 20,false)); titles.add(new ExcelElement("售价", "retailPrice", false,
	 * 20,false)); titles.add(new ExcelElement("销量", "salesVolume", false,
	 * 10,false)); titles.add(new ExcelElement("库存", "stock", false, 10,false));
	 * ViewExcel ve = new ViewExcel(); try { workbook =
	 * ve.resultSetToExcel(titles, list, GoodsVO.class,false); } catch
	 * (Exception e) { e.printStackTrace(); } return workbook; }
	 */

	public static HSSFWorkbook transactionAnalysisStatisticalReport(List<TransactionAnalysisVO> list,
			Integer analysisType) {
		HSSFWorkbook workbook = new HSSFWorkbook();
		List<ExcelElement> titles = new ArrayList<ExcelElement>();
		titles.add(new ExcelElement("下单人数", "ordersUserCount", false, 20, false));
		titles.add(new ExcelElement("下单件数", "ordersGoodsCount", false, 20, false));
		titles.add(new ExcelElement("下单笔数", "ordersCount", false, 20, false));
		titles.add(new ExcelElement("下单金额(元)", "ordersMoney", false, 20, false));
		titles.add(new ExcelElement("支付人数", "payUserCount", false, 20, false));
		titles.add(new ExcelElement("支付件数", "payNumber", false, 20, false));
		titles.add(new ExcelElement("支付笔数", "payOrdersCount", false, 20, false));
		titles.add(new ExcelElement("支付金额", "payMoney", false, 20, false));
		// titles.add(new ExcelElement("下单转换率", "ordersConversion", false,
		// 20,false));
		// titles.add(new ExcelElement("支付转换率", "payConversion", false,
		// 20,false));
		titles.add(new ExcelElement("支付成功率", "paySuccess", false, 20, false));
		titles.add(new ExcelElement("客单价", "clientPrice", false, 20, false));
		if (analysisType == AnalysisType.DAY.toIntValue() || analysisType == AnalysisType.MONTH.toIntValue()) {
			titles.add(new ExcelElement("7天重复购买人数", "sevenRepeatPurchase", false, 20, false));
			titles.add(new ExcelElement("30天重复购买人数", "thirtyRepeatPurchase", false, 20, false));
			titles.add(new ExcelElement("90天重复购买人数", "ninetyRepeatPurchase", false, 20, false));
		}
		ViewExcel ve = new ViewExcel();
		try {
			workbook = ve.resultSetToExcel(titles, list, TransactionAnalysisVO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}

	public static HSSFWorkbook transactionAnalysisReport(List<TransactionAnalysisBO> list) {
		HSSFWorkbook workbook = new HSSFWorkbook();
		List<ExcelElement> titles = new ArrayList<ExcelElement>();
		titles.add(new ExcelElement("时间", "date", false, 20, false));
		titles.add(new ExcelElement("下单人数", "ordersUserCount", false, 20, false));
		titles.add(new ExcelElement("下单件数", "ordersGoodsCount", false, 20, false));
		titles.add(new ExcelElement("下单笔数", "ordersCount", false, 20, false));
		titles.add(new ExcelElement("下单金额(元)", "ordersMoney", false, 20, false));
		titles.add(new ExcelElement("支付人数", "payUserCount", false, 20, false));
		titles.add(new ExcelElement("支付件数", "payNumber", false, 20, false));
		titles.add(new ExcelElement("支付笔数", "payOrdersCount", false, 20, false));
		titles.add(new ExcelElement("支付金额(元)", "payMoney", false, 20, false));
		ViewExcel ve = new ViewExcel();
		try {
			workbook = ve.resultSetToExcel(titles, list, TransactionAnalysisBO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}

	public static HSSFWorkbook ordersAndDetailsReport(List<OrdersAndDetailsBO> list, Integer type) {
		HSSFWorkbook workbook = new HSSFWorkbook();
		int mgLength;
		List<ExcelElement> titles = new ArrayList<ExcelElement>();
		if (type == 2) {// 直邮订单
			titles.add(new ExcelElement("收货人", "addressName", false, 20, false));
			titles.add(new ExcelElement("收货联系方式", "addressPhone", false, 20, false));
			titles.add(new ExcelElement("收货地区", "addressArea", false, 20, false));
			titles.add(new ExcelElement("收货地址", "addressAddress", false, 20, false));
			titles.add(new ExcelElement("运费", "postage", false, 20, false));
			titles.add(new ExcelElement("配送方式", "distribution", false, 20, false));
			titles.add(new ExcelElement("物流名称", "logisticsName", false, 20, false));
			titles.add(new ExcelElement("物流单号", "logisticsNumber", false, 20, false));
			titles.add(new ExcelElement("发货时间", "deliveryTime", false, 20, false));
			titles.add(new ExcelElement("确认时间", "confirmTime", false, 20, false));
		} else if(type == 0){// 到店订单
			titles.add(new ExcelElement("用户名", "userName", false, 20, false));
			titles.add(new ExcelElement("联系方式", "userMobilePhone", false, 20, false));
			titles.add(new ExcelElement("核销时间", "useTime", false, 20, false));
		} else if(type == 1){//配送订单
			titles.add(new ExcelElement("收货人", "addressName", false, 20, false));
			titles.add(new ExcelElement("收货联系方式", "addressPhone", false, 20, false));
			titles.add(new ExcelElement("收货地区", "addressArea", false, 20, false));
			titles.add(new ExcelElement("收货地址", "addressAddress", false, 20, false));
			titles.add(new ExcelElement("餐盒费", "foodBoxCharge", false, 20, false));
			titles.add(new ExcelElement("配送费", "postage", false, 20, false));
			titles.add(new ExcelElement("配送方式", "distribution", false, 20, false));
			titles.add(new ExcelElement("接单时间", "acceptTime", false, 20, false));
			titles.add(new ExcelElement("配送时间", "deliveryTime", false, 20, false));
			titles.add(new ExcelElement("确认时间", "confirmTime", false, 20, false));
		} else if(type == 4){ //预定订单
			titles.add(new ExcelElement("预约人姓名", "consumeName", false, 20, false));
			titles.add(new ExcelElement("预约人联系方式", "consumePhone", false, 20, false));
			titles.add(new ExcelElement("预约服务", "serveName", false, 20, false));
			titles.add(new ExcelElement("预约技师", "technicianName", false, 20, false));
			titles.add(new ExcelElement("预约时间", "reserveTime", false, 20, false));
		} else if(type == 3){ //堂食订单
			titles.add(new ExcelElement("用户名", "userName", false, 20, false));
			titles.add(new ExcelElement("联系方式", "userMobilePhone", false, 20, false));
		} else if(type == 5){ //自提订单
			titles.add(new ExcelElement("取餐人姓名", "consumeName", false, 20, false));
			titles.add(new ExcelElement("取餐人联系方式", "consumePhone", false, 20, false));
			titles.add(new ExcelElement("餐盒费", "foodBoxCharge", false, 20, false));
		}
		titles.add(new ExcelElement("下单时间", "createdTime", false, 20, false));
		titles.add(new ExcelElement("付款时间", "payTime", false, 20, false));
		titles.add(new ExcelElement("完成时间", "completeTime", false, 20, false));
		titles.add(new ExcelElement("店铺订单编号", "shopOrderNumber", false, 30, false));
		titles.add(new ExcelElement("订单编号", "orderNumber", false, 20, false));
		titles.add(new ExcelElement("微信支付单号", "transactionNumber", false, 30, false));
		titles.add(new ExcelElement("所属门店", "shopName", false, 20, false));
		titles.add(new ExcelElement("订单金额", "realMoney", false, 20, false));
		titles.add(new ExcelElement("优惠金额", "couponsMoney", false, 20, false));
		titles.add(new ExcelElement("支付金额", "payMoney", false, 20, false));
		titles.add(new ExcelElement("差价", "priceDifference", false, 20, false));
		titles.add(new ExcelElement("支付方式", "payWayShow", false, 20, false));
		titles.add(new ExcelElement("订单类型", "typeShow", false, 20, false));
		titles.add(new ExcelElement("订单状态", "statusShow", false, 20, false));
		titles.add(new ExcelElement("备注", "remark", false, 20, false));
		mgLength=titles.size();
		
		// [商品名称og.goodsName,类型og.typeName,规格og.standard,数量og.number,价格og.price,是否免单商品og.isOpenRebate,状态og.status]
		titles.add(new ExcelElement("商品名称", "goodsName", false, 20, false));
		titles.add(new ExcelElement("类型", "typeName", false, 20, false));
		titles.add(new ExcelElement("规格", "ordersGoodsStandard", false, 20, false));
		titles.add(new ExcelElement("数量", "ordersGoodsNumber", false, 20, false));
		titles.add(new ExcelElement("单价", "ordersGoodsPrice", false, 20, false));
		titles.add(new ExcelElement("是否免单商品", "isOpenRebate", false, 20, false));
		titles.add(new ExcelElement("状态", "ordersGoodsStatusShow", false, 20, false));
		ViewExcel ve = new ViewExcel();
		try {
			workbook = ve.resultMergeSetToExcel(titles, list, OrdersAndDetailsBO.class, false,mgLength);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}

	public static HSSFWorkbook consumeRecordReport(List<PayHistoryBO> list) {
		HSSFWorkbook workbook = new HSSFWorkbook();
		List<ExcelElement> titles = new ArrayList<ExcelElement>();
		titles.add(new ExcelElement("昵称", "userName", false, 20, false));
		titles.add(new ExcelElement("联系电话", "userMobile", false, 20, false));
		titles.add(new ExcelElement("订单编号", "shopOrderNumber", false, 20, false));
		titles.add(new ExcelElement("支付方式", "payWay", false, 20, false));
		titles.add(new ExcelElement("消费金额(元)", "money", false, 20, false));
		titles.add(new ExcelElement("消费时间", "payTime", false, 20, false));

		ViewExcel ve = new ViewExcel();
		try {
			workbook = ve.resultSetToExcel(titles, list, PayHistoryBO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}

	public static HSSFWorkbook consumeRankingReport(List<PayHistoryBO> list) {
		HSSFWorkbook workbook = new HSSFWorkbook();
		List<ExcelElement> titles = new ArrayList<ExcelElement>();
		titles.add(new ExcelElement("昵称", "userName", false, 20, false));
		titles.add(new ExcelElement("联系电话", "userMobile", false, 20, false));
		titles.add(new ExcelElement("消费金额(元)", "totalMoney", false, 20, false));

		ViewExcel ve = new ViewExcel();
		try {
			workbook = ve.resultSetToExcel(titles, list, PayHistoryBO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}

	 public static HSSFWorkbook dataHistoryAnalysisReport(List<OrdersAndGoodsBO> list){
		 HSSFWorkbook workbook = new HSSFWorkbook();
		 int mgLength;
		 List<ExcelElement> titles = new ArrayList<ExcelElement>();
		 titles.add(new ExcelElement("行业", "industryFullName", false,20,false));
		 titles.add(new ExcelElement("店铺名称", "shopName", false, 20,false));
		 titles.add(new ExcelElement("订单编号", "orderNumber", false,20,false));
		 titles.add(new ExcelElement("店铺交易编号", "shopOrderNumber", false, 20,false));
		 titles.add(new ExcelElement("交易编号", "transactionNumber", false,30,false));
		 titles.add(new ExcelElement("支付方式", "payWayShow", false,20,false));
		 titles.add(new ExcelElement("订单金额", "realMoney", false, 20,false));
		 titles.add(new ExcelElement("优惠金额", "couponsMoney", false,20,false));
		 titles.add(new ExcelElement("配送费", "postage", false,20,false));
		 titles.add(new ExcelElement("支付金额", "payMoney", false,20,false));
		 titles.add(new ExcelElement("差价", "priceDifference", false,20,false));
		 titles.add(new ExcelElement("优惠券名称", "couponsName", false,20,false));
		 titles.add(new ExcelElement("优惠券类型", "couponsTypeName", false,20,false));
		 titles.add(new ExcelElement("分润金额", "shareBenefitMoney", false,20,false));
		 titles.add(new ExcelElement("流水金额", "referrerMoney", false,20,false));
		 titles.add(new ExcelElement("代理分润", "agencyBenefit", false,20,false));
		 titles.add(new ExcelElement("代理流水", "agencyAccount", false,20,false));
		 titles.add(new ExcelElement("总让利金额", "profitMoney", false,20,false));
		 titles.add(new ExcelElement("商家得到金额", "shopMoney", false,20,false));
		 titles.add(new ExcelElement("毛利", "grossMargin", false,20,false));
		 titles.add(new ExcelElement("毛利率", "grossMarginRate", false,20,false));
		 mgLength=titles.size();
		 
		 titles.add(new ExcelElement("商品名称", "goodsName", false,60,false));
		 titles.add(new ExcelElement("商品分类", "typeName", false,20,false));
		 titles.add(new ExcelElement("规格属性", "skuContentName", false,20,false));
		 titles.add(new ExcelElement("商品单价", "price", false,20,false));
		 titles.add(new ExcelElement("购买数量", "number", false,20,false));
		 titles.add(new ExcelElement("是否返利", "isOpen", false,20,false));
		 titles.add(new ExcelElement("让利值", "profit", false,20,false));
		 titles.add(new ExcelElement("优惠金额", "goodsCouponsMoney", false,20,false));
		 titles.add(new ExcelElement("一级推荐人", "primaryBenefitName", false,20,false));
		 titles.add(new ExcelElement("一级分润比例", "primaryBenefitRation", false,20,false));
		 titles.add(new ExcelElement("一级分润金额", "primaryBenefitMoney", false,20,false));
		 titles.add(new ExcelElement("二级推荐人", "secondBenefitName", false,20,false));
		 titles.add(new ExcelElement("二级分润比例", "secondBenefitRation", false,20,false));
		 titles.add(new ExcelElement("二级分润金额", "secondBenefitMoney", false,20,false));
		 titles.add(new ExcelElement("流水推荐人", "referrerName", false,20,false));
		 titles.add(new ExcelElement("推荐人身份", "identityName", false,20,false));
		 titles.add(new ExcelElement("流水比例", "referrerRation", false,20,false));
		 titles.add(new ExcelElement("流水金额", "goodsReferrerMoney", false,20,false));
		 titles.add(new ExcelElement("代理分润", "goodsAgencyBenefit", false,20,false));
		 titles.add(new ExcelElement("代理流水", "goodsAgencyAccount", false,20,false));
		 titles.add(new ExcelElement("让利金额", "goodsProfitMoney", false,20,false));
		 titles.add(new ExcelElement("商家获取消费分润占比", "shopGetBenefitRation", false,20,false));
		 titles.add(new ExcelElement("商家获取消费分润金额", "shopGetBenefitMoney", false,20,false));
		 titles.add(new ExcelElement("商家得到金额", "goodsShopMoney", false,20,false));
		 titles.add(new ExcelElement("毛利", "goodsGrossMargin", false,20,false));
		 titles.add(new ExcelElement("毛利率", "goodsGrossMarginRate", false,20,false));
		 
		 ViewExcel ve = new ViewExcel();
		 try {
			 workbook = ve.resultMergeSetToExcel(titles, list, OrdersAndGoodsBO.class, false,mgLength);
		 } catch (Exception e) {
			 e.printStackTrace();
		 }
		 return workbook;
	 }
	
	public static HSSFWorkbook shopGoodsListReport(List<GoodsBO> list){
		HSSFWorkbook workbook = new HSSFWorkbook();
		List<ExcelElement> titles = new ArrayList<ExcelElement>();
		titles.add(new ExcelElement("编号", "code", false, 20, false));
		titles.add(new ExcelElement("名称", "name", false, 20, false));
		titles.add(new ExcelElement("类型", "typeName", false, 20, false));
		titles.add(new ExcelElement("价格", "price", false, 20, false));
		titles.add(new ExcelElement("单价范围", "skuRangePrice", false, 20, false));
		titles.add(new ExcelElement("参考价", "referencePrice", false, 20, false));
		titles.add(new ExcelElement("库存", "stock", false, 20, false));
		titles.add(new ExcelElement("运费", "postagePrice", false, 20, false));
		titles.add(new ExcelElement("品牌", "brandName", false, 20, false));
		titles.add(new ExcelElement("SKU", "isOpenSkuShow", false, 20, false));
		titles.add(new ExcelElement("推荐", "isRecommendShow", false, 20, false));
		titles.add(new ExcelElement("返利", "isOpenRebateShow", false, 20, false));
		titles.add(new ExcelElement("状态", "statusShow", false, 20, false));
		titles.add(new ExcelElement("更新时间", "updatedTime", false, 20, false));
		ViewExcel ve = new ViewExcel();
		try {
			workbook = ve.resultSetToExcel(titles, list, GoodsBO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}
	
	public static HSSFWorkbook chainTransactionAnalysisReport(List<TransactionAnalysisVO> tavList){
		HSSFWorkbook hwb=new HSSFWorkbook();
		List<ExcelElement> titles=new ArrayList<>();
		titles.add(new ExcelElement("下单人数","ordersUserCount",false,20,false));
		titles.add(new ExcelElement("下单件数","ordersGoodsCount",false,20,false));
		titles.add(new ExcelElement("下单笔数","ordersCount",false,20,false));
		titles.add(new ExcelElement("下单金额(元)","ordersMoney",false,20,false));
		titles.add(new ExcelElement("支付人数","payUserCount",false,20,false));
		titles.add(new ExcelElement("支付件数","payNumber",false,20,false));
		titles.add(new ExcelElement("支付笔数","payOrdersCount",false,20,false));
		titles.add(new ExcelElement("支付金额(元)","payMoney",false,20,false));
		titles.add(new ExcelElement("支付成功率(%)","paySuccess",false,20,false));
		titles.add(new ExcelElement("客单价(元)","clientPrice",false,20,false));
		titles.add(new ExcelElement("7天重复购买人数","sevenRepeatPurchase",false,20,false));
		titles.add(new ExcelElement("30天重复购买人数","thirtyRepeatPurchase",false,20,false));
		titles.add(new ExcelElement("90天重复购买人数","ninetyRepeatPurchase",false,20,false));
		ViewExcel ve=new ViewExcel();
		try {
			hwb=ve.resultSetToExcel(titles, tavList, TransactionAnalysisVO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hwb;
	}
	
	public static HSSFWorkbook chainTransactionAnalysisListReport(List<TransactionAnalysisVO> tavList){
		HSSFWorkbook hwb=new HSSFWorkbook();
		List<ExcelElement> titles=new ArrayList<>();
		titles.add(new ExcelElement("下单日期","date",false,20,false));
		titles.add(new ExcelElement("下单人数","ordersUserCount",false,20,false));
		titles.add(new ExcelElement("下单件数","ordersGoodsCount",false,20,false));
		titles.add(new ExcelElement("下单笔数","ordersCount",false,20,false));
		titles.add(new ExcelElement("下单金额(元)","ordersMoney",false,20,false));
		titles.add(new ExcelElement("支付人数","payUserCount",false,20,false));
		titles.add(new ExcelElement("支付件数","payNumber",false,20,false));
		titles.add(new ExcelElement("支付笔数","payOrdersCount",false,20,false));
		titles.add(new ExcelElement("支付金额(元)","payMoney",false,20,false));
		ViewExcel ve=new ViewExcel();
		try {
			hwb=ve.resultSetToExcel(titles, tavList, TransactionAnalysisVO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hwb;
	}
	
	public static HSSFWorkbook goodsHistoryAnalysisReport(List<GoodsAnalysisVO> gavList){
		HSSFWorkbook hwb=new HSSFWorkbook();
		List<ExcelElement> titles=new ArrayList<>();
		titles.add(new ExcelElement("在架商品数","putawayGoodsCount",false,20,false));
		titles.add(new ExcelElement("下架商品数","soldoutGoodsCount",false,20,false));
		titles.add(new ExcelElement("商品收藏量","goodsCollections",false,20,false));
		titles.add(new ExcelElement("商品曝光量","exposureNumber",false,20,false));
		titles.add(new ExcelElement("商品访客数(商品UV)","visitUserCount",false,20,false));
		titles.add(new ExcelElement("商品浏览量(商品PV)","goodsViewNumber",false,20,false));
		titles.add(new ExcelElement("被访问的商品数","visitedGoodsCount",false,20,false));
		titles.add(new ExcelElement("商品加购量","cartNumber",false,20,false));
		titles.add(new ExcelElement("商品转化率","goodsRate",false,20,false));
		ViewExcel ve=new ViewExcel();
		try {
			hwb=ve.resultSetToExcel(titles, gavList,GoodsAnalysisVO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hwb;
	}
	
	public static HSSFWorkbook goodsHistoryInfoAnalysisReport(List<GoodsAnalysisInfoVO> gaivList){
		HSSFWorkbook hwb=new HSSFWorkbook();
		List<ExcelElement> titles=new ArrayList<>();
		titles.add(new ExcelElement("商品名称","name",false,20,false));
		titles.add(new ExcelElement("商品价格","price",false,20,false));
		titles.add(new ExcelElement("曝光次数","goodsExposureNumber",false,20,false));
		titles.add(new ExcelElement("下单人数","ordersUserCount",false,20,false));
		titles.add(new ExcelElement("下单件数","ordersGoodsNumber",false,20,false));
		titles.add(new ExcelElement("支付人数","payUserCount",false,20,false));
		titles.add(new ExcelElement("支付件数","payGoodsNumber",false,20,false));
		titles.add(new ExcelElement("访客数","visitUserCount",false,20,false));
		titles.add(new ExcelElement("浏览量","goodsViewNumber",false,20,false));
		titles.add(new ExcelElement("收藏量","goodsCollections",false,20,false));
		titles.add(new ExcelElement("加购件数","cartGoodsNumber",false,20,false));
		titles.add(new ExcelElement("单品转化率","singleRate",false,20,false));
		ViewExcel ve=new ViewExcel();
		try {
			hwb=ve.resultSetToExcel(titles, gaivList,GoodsAnalysisInfoVO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hwb;
	}
	
	public static HSSFWorkbook shopHistoryAnalysisReport(List<ShopAnalysisVO> savList){
		HSSFWorkbook hwb=new HSSFWorkbook();
		List<ExcelElement> titles=new ArrayList<>();
		titles.add(new ExcelElement("访客数","shopVisitUserCount",false,20,false));
		titles.add(new ExcelElement("浏览量","shopViewNumber",false,20,false));
		titles.add(new ExcelElement("店铺分享次数","shopShareNumber",false,20,false));
		titles.add(new ExcelElement("店铺分享人数","shopShareUserCount",false,20,false));
		titles.add(new ExcelElement("店铺分享访问人数","shopShareVisitCount",false,20,false));
		ViewExcel ve=new ViewExcel();
		try {
			hwb=ve.resultSetToExcel(titles, savList, ShopAnalysisVO.class, false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hwb;
	}
}
